package com.seanLab.web;

import com.seanLab.service.DataService;
import com.seanLab.service.RecommendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by ailly on 17-10-9.
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/v1/data")
public class DataController {
    @Autowired
    private DataService dataService;

    //从已有文章表中抽取标签，添加至已有图片表中
    @RequestMapping(path = "/extractImgTagFromExistArticle", method = RequestMethod.GET)
    public int extractImgTagsFromExistArticleTest() {
        this.dataService.extractImgTagsFromExistArticleTest();
        return 0;
    }

    //同步mongodb中image表至ES
    @RequestMapping(path = "/loadToES", method = RequestMethod.GET)
    public int loadImagesToES() {
        this.dataService.loadImagesToES();
        return 0;
    }
}
